package cn.wolfcode.luowowo.article.domain;

import cn.wolfcode.luowowo.common.domain.BaseDomain;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

@Getter
@Setter
public class HotelTheme extends BaseDomain{
    private Long id;
    private String content;  //主题内容
    private int state;       //状态
    private String ref;
    private Long[] refIds;   //


    //从数据库拿出的id拼接字符串转换成数组
    public Long[] getRefIds(){
        Long[] ids = null;
        if(StringUtils.isNotBlank(ref)){
            String[] strs = ref.split(",");
            ids = new Long[strs.length];
            for (int i = 0; i <strs.length ; i++) {
                ids[i] =  Long.parseLong(strs[i]);
            }
        }
        return ids;
    }
}